package com.itheima.HomeWork;

import java.util.ArrayList;
import java.util.Collections;
import java.util.function.Function;

public class Demo4 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list,"1","2","3","4");
        /*list.stream().map(new Function<String, Integer>() {
            @Override
            public Integer apply(String s) {
                return Integer.parseInt(s);
            }
        }).forEach(s-> System.out.println(s));*/
        list.stream().map(Integer::parseInt).forEach(s-> System.out.println(s));

    }
}
